package com.zhoutao.blog.seven.api;

import com.zhoutao.blog.seven.model.AdminTableResp;
import com.zhoutao.blog.seven.model.response.Menu;
import com.zhoutao.blog.seven.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/admin/api/menu")
public class AdminMenuController {

    @Autowired
    private MenuService menuService;

    @GetMapping
    public AdminTableResp<Menu> articleList() {
        List<Menu> menus = menuService.all();
        return AdminTableResp.success(menus);
    }


}
